//
//  TPVerticalPageContainerView.h
//  ThePaperBase
//
//  Created by liubo on 2021/8/20.
//  Copyright © 2021 scar1900. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "LBVerticalPageViewCell.h"

NS_ASSUME_NONNULL_BEGIN

@class LBVerticalPageContainerView;

@protocol TPVerticalPageContainerViewDelegate <NSObject>

@optional

/// 翻页之后返回到中间位置
- (void)moveBackMiddleAfterTranslation:(LBVerticalPageContainerView *)verticalPageView;

@end

@protocol LBVerticalPageContainerViewDataSource <NSObject>

//竖直视图数量
- (NSInteger)numberOfViewForVerticalPageContainerView:(LBVerticalPageContainerView *)rollingView;
//返回竖直分页单个视图
- (LBVerticalPageViewCell *)verticalPageView:(LBVerticalPageContainerView *)rollingView viewAtIndex:(NSUInteger)index;

@end

@interface LBVerticalPageContainerView : UIView

///数据源
@property (nonatomic, weak) id <LBVerticalPageContainerViewDataSource> dataSource;

///代理
@property (nonatomic, weak) id <TPVerticalPageContainerViewDelegate> delegate;

///当前页面索引
@property (nonatomic, assign, readonly) NSInteger currentIndex;

///注册某种单个视图
- (void)registerClass:(Class)cellClass forViewReuseIdentifier:(NSString *)identifier;
///获取单个视图
- (__kindof LBVerticalPageViewCell *)dequeueReusableCellWithIdentifier:(NSString *)identifier;

///滚动到下一页
- (void)gotoNext;

///下拉回到上一页
- (void)pullToLast;

///刷新视图
- (void)reloadData;

@end

NS_ASSUME_NONNULL_END
